home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ufw.postrm < prev    next >
Text File  |  2008-10-08  |  2KB  |  57 lines

  1. #!/bin/sh -e
  2.  
  3. RULES_PATH="/etc/ufw"
  4. USER_PATH="/var/lib/ufw"
  5. case "$1" in
  6.     remove)
  7.         ;;
  8.  
  9.     purge)
  10.         if [ -e /usr/share/debconf/confmodule ]; then
  11.         . /usr/share/debconf/confmodule
  12.         db_purge
  13.     fi
  14.         update-rc.d ufw remove > /dev/null
  15.  
  16.         for f in before.rules before6.rules after.rules after6.rules
  17.         do
  18.             if which ucf > /dev/null 2>&1; then
  19.                 ucf -p $RULES_PATH/$f
  20.             fi
  21.             rm -f $RULES_PATH/$f
  22.             rm -f $RULES_PATH/$f.ucf-old $RULES_PATH/$f.ucf-new $RULES_PATH/$f.ucf-dist
  23.         done
  24.         rm -f $RULES_PATH/ufw.rules $RULES_PATH/ufw.rules.dpkg-old
  25.         rm -f $USER_PATH/user.rules $USER_PATH/user6.rules
  26.         rm -f /etc/ufw/ufw.conf
  27.  
  28.         # go back to default accept
  29.         for exe in iptables ip6tables
  30.         do
  31.             if which $exe > /dev/null 2>&1; then
  32.                 $exe -F 2>/dev/null || true
  33.                 $exe -X 2>/dev/null || true
  34.                 $exe -P INPUT ACCEPT 2>/dev/null || true
  35.                 $exe -P OUTPUT ACCEPT 2>/dev/null || true
  36.                 $exe -P FORWARD ACCEPT 2>/dev/null || true
  37.             fi
  38.         done
  39.         ;;
  40.  
  41.     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  42.         ;;
  43.  
  44.     *)
  45.         echo "postrm called with unknown argument '$1'" >&2
  46.         exit 1
  47.         ;;
  48. esac
  49.  
  50. # Automatically added by dh_installdebconf
  51. if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
  52.     . /usr/share/debconf/confmodule
  53.     db_purge
  54. fi
  55. # End automatically added section
  56.  
  57.